package com.wsq.animation.animation;

import android.animation.IntEvaluator;
import android.animation.TypeEvaluator;
import android.util.Log;

/**
 * Date:2022/5/6
 * Time:2:46
 * author:wushengqi
 *
 * 估值器
 */
public class MyEvaluator implements TypeEvaluator {


    /**
     * This function returns the result of linearly interpolating the start and end values, with
     * <code>fraction</code> representing the proportion between the start and end values. The
     * calculation is a simple parametric calculation: <code>result = x0 + t * (x1 - x0)</code>,
     * where <code>x0</code> is <code>startValue</code>, <code>x1</code> is <code>endValue</code>,
     * and <code>t</code> is <code>fraction</code>.
     *
     * @param fraction   The fraction from the starting to the ending values
     * @param startValue The start value. 表示整个动画的属性起始值
     * @param endValue   The end value.  表示整个动画的属性结束值
     * @return A linear interpolation between the start and end values, given the
     * <code>fraction</code> parameter.
     */
    @Override
    public Object evaluate(float fraction, Object startValue, Object endValue) {
        Log.e("估值器变化情况", "fraction:" + fraction + "  startValue:" + startValue + "  " + endValue) ;
        return fraction * 2;
    }
}
